This came out of a question from Bruno in response to Ticket
#3 Component without recurrence properties should enumerate just itself.
In attempting to understand his problem I wrote this test
program
require 'rubygems'
require 'ri_cal'
cal = RiCal.parse_string <<ENDCAL
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20090520T091929Z
LAST-MODIFIED:20090520T092025Z
DTSTAMP:20090520T091929Z
UID:36197790-cf15-4aba-9213-f61d434c4cd8
SUMMARY:event1
DTSTART;VALUE=DATE:20090601
DTEND;VALUE=DATE:20090602
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
CREATED:20090520T092032Z
LAST-MODIFIED:20090520T092052Z
DTSTAMP:20090520T092032Z
UID:d41c124a-65c3-400e-bd04-1d2ee7b98352
SUMMARY:event2
RRULE:FREQ=MONTHLY;INTERVAL=1
DTSTART;VALUE=DATE:20090603
DTEND;VALUE=DATE:20090604
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR
ENDCAL
puts "occurrences of first event:"
cal.first.events.first.occurrences(:after => Date.parse('01/01/1990'), :before => Date.parse("01/01/2010")).each do|occur|
puts "#{occur.dtstart} which is a #{occur.dtstart.class}"
end
puts "\noccurrences of second event"
cal.first.events[1].occurrences(:after => Date.parse('01/01/1990'), :before => Date.parse("01/01/2010")).each do |occur|
puts "#{occur.dtstart} which is a #{occur.dtstart.class}"
end
which produces the following output:
occurrences of first event: 2009-06-01 which is a Date
occurrences of second event 2009-06-03T00:00:00+00:00 which is a
DateTime 2009-07-03T00:00:00+00:00 which is a DateTime
2009-08-03T00:00:00+00:00 which is a DateTime
2009-09-03T00:00:00+00:00 which is a DateTime
2009-10-03T00:00:00+00:00 which is a DateTime
2009-11-03T00:00:00+00:00 which is a DateTime
2009-12-03T00:00:00+00:00 which is a DateTime
The first event gives a date dtstart because it has no
recurrence rules, the second event, which does have a recurrence
rule, is changing the type of the dtstart to DateTime. This should
be fixed.